// @ts-nocheck
// 交互层样式
export const useStyle = (mouPosDataPro, currentNode, sizeInterval) => {
  const mouPosData = mouPosDataPro && mouPosDataPro.current && mouPosDataPro.current.res;
  if (!currentNode || !mouPosData) return {};
  
  let curPos = currentNode.dom.current.getBoundingClientRect()
  currentNode.x = curPos.x
  currentNode.y = curPos.y
  currentNode.h = curPos.height
  currentNode.w = curPos.width

  const topSizeStyle = {
    top: mouPosData[2] === 'inside' ? sizeInterval : -sizeInterval,
    display: mouPosData[1] === 'top' ? 'block' : 'none',
  };
  const rightSizeStyle = {
    right: mouPosData[2] === 'inside' ? sizeInterval : -sizeInterval,
    display: mouPosData[1] === 'right' ? 'block' : 'none',
  };
  const bottomSizeStyle = {
    bottom: mouPosData[2] === 'inside' ? sizeInterval : -sizeInterval,
    display: mouPosData[1] === 'bottom' ? 'block' : 'none',
  };
  const leftSizeStyle = {
    left: mouPosData[2] === 'inside' ? sizeInterval : -sizeInterval,
    display: mouPosData[1] === 'left' ? 'block' : 'none',
  };
  
  const dynamicDrop = {
    y: currentNode.y,
    x: currentNode.x,
    w: currentNode.w,
    h: currentNode.h,
  };
  return {
    dynamicDrop,
    topSizeStyle,
    rightSizeStyle,
    bottomSizeStyle,
    leftSizeStyle,
  };
};
